let obj = { //object
    name: '梅老板',
    age: 18,
    health: 100,
    smoking: function () { //function 函数 obj不行成作用域
        console.log('来根华子')
        //obj.health-- //this指向obj对象
        this.health-- //this指向obj对象
    },
    drink: function () { //function 函数
        console.log('来杯台子')
        //obj.health++ //this指向obj对象
        this.health++ //this指向obj对象
    }
}
//obj.age++
obj.smoking() //来根华子
obj.smoking()
obj.smoking()
obj.drink() //来杯台子
obj.drink()
obj.drink()
//console.log(obj.age) //19
console.log(obj.health) 
obj.girlfriend = '梅姐' //给obj对象添加一个属性girlfriend，值为'梅姐'
console.log(obj) //{name: '梅老板', age: 19, health: 100, smoking: ƒ, drink: ƒ, girlfriend: '梅姐'}
// let meiGirl = 'myGirl' //meiGirl是一个变量，值为'myGirl
// //obj.meiGirl = '笑笑' //给obj对象添加一个属性meiGirl，值为'myGirl'
// obj[meiGirl] = '笑笑' //给obj对象添加一个属性meiGirl，值为'myGirl'
console.log(obj) 
delete obj.girlfriend //删除obj对象的girlfriend属性



let obj2 = new Object({ //object 构造函数
    name: '梅老板',
    age: 18,
    health: 100,
    smoking: function () { //function 函数 obj不行成作用域
        console.log('来根华子')
        //obj.health-- //this指向obj对象
        this.health-- //this指向obj对象
    },
    drink: function () { //function 函数
        console.log('来杯台子')
        //obj.health++ //this指向obj对象
        this.health++ //this指向obj对象
    }
})  